package com.retail.lottery.colalottery.job.notice;

import com.retail.lottery.colalottery.job.notice.service.BbqMessageNoticeCommonService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.context.annotation.DependsOn;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;
import javax.annotation.Resource;

@Component
@Slf4j
@DependsOn("redisUtils")
public class BBQCreateMessageNoticeJob {
    @Resource
    private BbqMessageNoticeCommonService bbqMessageNoticeCommonService;
    @PostConstruct
    public void init() {
        createNotice();
    }

    @Scheduled(cron = "0/30 * * * * ?")
    private void createNotice() {
        bbqMessageNoticeCommonService.createNotice();
    }
}
